package com.dex4d.ui.wallet.activity;

import android.view.View;

import com.dex4d.R;
import com.dex4d.core.AppToolBarBaseActivity;
import com.dex4d.event.ExitEvent;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import butterknife.OnClick;

/**
 * Created by chengyuchun on 2018/10/26.
 */
public class RestoreActivity extends AppToolBarBaseActivity {
    @Override
    protected void initToolbar() {
        showBackView();
        showTitle(getString(R.string.restore));
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_restore;
    }

    @Override
    protected void initVariables() {
        EventBus.getDefault().register(this);
    }

    @Override
    protected void loadData() {

    }

    @OnClick({R.id.sli_keystore,R.id.sli_mnemonic})
    public void onViewClick(View view){
        switch (view.getId()){
            case R.id.sli_keystore:
                openActivity(RestoreKeystoreActivity.class);
                break;
            case R.id.sli_mnemonic:
                openActivity(RestoreMnemonicActivity.class);
                break;
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onMessageEvent(ExitEvent event) {
        finish();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }
}
